import request from "../../utils/request";

// 请求水压表
export const getPressure = () => {
    return request.get('classes/pressureDetailList')
}

// 请求10条
export const getPressureTen = () => {
    return request.get('classes/pressureDetailList', {
        params: {
            where: {
                pressure: {"$gte": 0.24}
            }
        }
    })
}

// 根据地点时间查询
interface Where {
    region: string;
    turnoverTime?: unknown
}
export const getPressureT = (address: string = '', time: string = '') => {
    let where: Where =  {
        region: address,
        turnoverTime: {"$regex": `${time}`, "$options":"i"}
    }
    if (time === '') delete where['turnoverTime']
    return request.get('classes/pressureDetailList', {
        params: {
            where
        }
    })
}
